import Hips from '@hips/vue-core';
import { AppDsx } from '@hips/plugin-dataset-vuex';
// import HipsI18n from '@hips/plugin-vue-i18n';
// import i18n from './i18n';
import FastClick from 'fastclick';
import App from './App.vue';

import 'x-photoswipe/dist/photoswipe.css';
import 'x-photoswipe/dist/default-skin/default-skin.css';
import './style/reset.css';
import './style/normalize.css';

import { Toast, Indicator, Dialog } from '@hips/vue-ui';

import { createAxios } from './request';

if (process.env.VUE_APP_ENV !== 'production') {
  const VConsole = require('vconsole');
  new VConsole(); // eslint-disable-line
}

const plugins = [
  Toast,
  Indicator,
  Dialog,
  {
    plugin: AppDsx,
    options: {
      axios: createAxios(),
    },
  },
  // {
  //   plugin: HipsI18n,
  //   options: i18n,
  // },
];

const hips = new Hips({
  el: '#app',
  root: App,
  useDsx: true,
});

hips.inject(plugins);

hips.start();

new FastClick(document.body);
